package com.lynn.redis.controller;

import com.lynn.redis.bean.User;
import com.lynn.redis.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName UserController
 * @Description TODO
 * @Author ly
 * @Date 2019-06-04 18:00
 * @Version 1.0
 */
@RestController
public class UserController {

    @Autowired
    private IUserService userService;

    @RequestMapping("/getUser")
    public User getUser(String id){
        return userService.getUserById(id);
    }

    @RequestMapping("/get")
    public User getUserFromRedis(){
        return userService.getUserFromRedis();
    }

    @RequestMapping("/init")
    public String init(){
        return userService.init();
    }

    @RequestMapping("/demo1")
    public String demo1(){
        return userService.demo1("1");
    }
    @RequestMapping("/demo2")
    public String demo2(){
        return userService.demo2("2");
    }
}
